package com.clss.webrtclibrary;

import com.google.gson.JsonElement;

import java.util.List;

/**
 * 信令内容
 * @author liuv
 * @date 2018/5/2
 */

public class KurentoSignallingBean {
    private static final String TAG = "KurentoSignallingBean";

    private String id, pin, room, sdpOffer, name, sender, sdpAnswer, videourl, protocol, player, role, result, compositeTag, videoTag;
    private Candidate candidate;
    private Boolean isSeekable;
    private Long initSeekable, endSeekable, videoDuration, position;
    private JsonElement data;
    private ExtraInfoBean extraInfo;
    /**
     * data : []
     * status : true
     * iceServers : [{"urls":"stun:v1.video110.cn:34780"},{"urls":"turn:v1.video110.cn:34780","username":"video1","credential":"12wwfthisisturnserver1"},{"urls":"stun:v2.video110.cn:34780"},{"urls":"turn:v2.video110.cn:34780","username":"video1","credential":"12wwfthisisturnserver1"}]
     */

    private List<IceServersBean> iceServers;

    public String getSdpAnswer() {
        return sdpAnswer;
    }

    public void setSdpAnswer(String sdpAnswer) {
        this.sdpAnswer = sdpAnswer;
    }

    public long getInitSeekable() {
        return initSeekable;
    }

    public void setInitSeekable(long initSeekable) {
        this.initSeekable = initSeekable;
    }

    public long getEndSeekable() {
        return endSeekable;
    }

    public void setEndSeekable(long endSeekable) {
        this.endSeekable = endSeekable;
    }

    public long getVideoDuration() {
        return videoDuration;
    }

    public void setVideoDuration(long videoDuration) {
        this.videoDuration = videoDuration;
    }

    public boolean isSeekable() {
        return isSeekable;
    }

    public void setSeekable(boolean seekable) {
        isSeekable = seekable;
    }

    public void setInitSeekable(Long initSeekable) {
        this.initSeekable = initSeekable;
    }

    public void setEndSeekable(Long endSeekable) {
        this.endSeekable = endSeekable;
    }

    public void setVideoDuration(Long videoDuration) {
        this.videoDuration = videoDuration;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public ExtraInfoBean getExtraInfo() {
        return extraInfo;
    }

    public void setExtraInfo(ExtraInfoBean extraInfo) {
        this.extraInfo = extraInfo;
    }

    public JsonElement getData() {
        return data;
    }

    public void setData(JsonElement data) {
        this.data = data;
    }

    public List<IceServersBean> getIceServers() {
        return iceServers;
    }

    public void setIceServers(List<IceServersBean> iceServers) {
        this.iceServers = iceServers;
    }

    public Long getPosition() {
        return position;
    }

    public void setPosition(Long position) {
        this.position = position;
    }

    public String getCompositeTag() {
        return compositeTag;
    }

    public void setCompositeTag(String compositeTag) {
        this.compositeTag = compositeTag;
    }

    public String getVideoTag() {
        return videoTag;
    }

    public void setVideoTag(String videoTag) {
        this.videoTag = videoTag;
    }

    public Boolean getSeekable() {
        return isSeekable;
    }

    public void setSeekable(Boolean seekable) {
        isSeekable = seekable;
    }

    public static class Candidate{

        public Candidate(String candidate, String sdpMid, int sdpMLineIndex) {
            this.candidate = candidate;
            this.sdpMid = sdpMid;
            this.sdpMLineIndex = sdpMLineIndex;
        }

        private String candidate;
        private String sdpMid;
        private int sdpMLineIndex;

        public String getCandidate() {
            return candidate;
        }

        public void setCandidate(String candidate) {
            this.candidate = candidate;
        }

        public String getSdpMid() {
            return sdpMid;
        }

        public void setSdpMid(String sdpMid) {
            this.sdpMid = sdpMid;
        }

        public int getSdpMLineIndex() {
            return sdpMLineIndex;
        }

        public void setSdpMLineIndex(int sdpMLineIndex) {
            this.sdpMLineIndex = sdpMLineIndex;
        }

        @Override
        public String toString() {
            return "Candidate{" +
                    "candidate='" + candidate + '\'' +
                    ", sdpMid='" + sdpMid + '\'' +
                    ", sdpMLineIndex=" + sdpMLineIndex +
                    '}';
        }
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPin() {
        return pin;
    }

    public void setPin(String pin) {
        this.pin = pin;
    }

    public String getRoom() {
        return room;
    }

    public void setRoom(String room) {
        this.room = room;
    }

    public String getSdpOffer() {
        return sdpOffer;
    }

    public void setSdpOffer(String sdpOffer) {
        this.sdpOffer = sdpOffer;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public Candidate getCandidate() {
        return candidate;
    }

    public void setCandidate(Candidate candidate) {
        this.candidate = candidate;
    }

    public String getVideourl() {
        return videourl;
    }

    public void setVideourl(String videourl) {
        this.videourl = videourl;
    }

    public String getProtocol() {
        return protocol;
    }

    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    public String getPlayer() {
        return player;
    }

    public void setPlayer(String player) {
        this.player = player;
    }

    @Override
    public String toString() {
        return "KurentoSignallingBean{" +
                "id='" + id + '\'' +
                ", pin='" + pin + '\'' +
                ", room='" + room + '\'' +
                ", sdpOffer='" + sdpOffer + '\'' +
                ", name='" + name + '\'' +
                ", sender='" + sender + '\'' +
                ", sdpAnswer='" + sdpAnswer + '\'' +
                ", videourl='" + videourl + '\'' +
                ", protocol='" + protocol + '\'' +
                ", player='" + player + '\'' +
                ", role='" + role + '\'' +
                ", result='" + result + '\'' +
                ", candidate=" + candidate +
                ", isSeekable=" + isSeekable +
                ", initSeekable=" + initSeekable +
                ", endSeekable=" + endSeekable +
                ", videoDuration=" + videoDuration +
                ", data=" + data +
                ", extraInfo=" + extraInfo +
                '}';
    }

    public static class DataBean {
        /**
         * name : 80028400-7400-11e7-888f-af9b0e46710b
         * extraInfo : {"order":"1"}
         */

        private String name;
        private ExtraInfoBean extraInfo;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public ExtraInfoBean getExtraInfo() {
            return extraInfo;
        }

        public void setExtraInfo(ExtraInfoBean extraInfo) {
            this.extraInfo = extraInfo;
        }

        @Override
        public String toString() {
            return "DataBean{" +
                    "nameX='" + name + '\'' +
                    ", extraInfo=" + extraInfo +
                    '}';
        }
    }

    public static class ExtraInfoBean {
        public ExtraInfoBean(int order, String videoGroupId, String publisher, String unitName) {
            this.order = order;
            this.videoGroupId = videoGroupId;
            this.publisher = publisher;
            this.unitName = unitName;
        }

        /**
         * order : 4
         */

        private int order;
        private String videoGroupId;
        private String publisher;
        private String unitName;

        public String getPublisher() {
            return publisher;
        }

        public void setPublisher(String publisher) {
            this.publisher = publisher;
        }

        public int getOrder() {
            return order;
        }

        public void setOrder(int order) {
            this.order = order;
        }

        public String getVideoGroupId() {
            return videoGroupId;
        }

        public void setVideoGroupId(String videoGroupId) {
            this.videoGroupId = videoGroupId;
        }

        public String getUnitName() {
            return unitName;
        }

        public void setUnitName(String unitName) {
            this.unitName = unitName;
        }
    }

    public static class IceServersBean {
        /**
         * urls : stun:v1.video110.cn:34780
         * username : video1
         * credential : 12wwfthisisturnserver1
         */

        private String urls;
        private String username;
        private String credential;

        public String getUrls() {
            return urls;
        }

        public void setUrls(String urls) {
            this.urls = urls;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getCredential() {
            return credential;
        }

        public void setCredential(String credential) {
            this.credential = credential;
        }
    }
}
